using ASP;
using HoWave.Web.Shop;
using System;
using System.Data;
using System.Web.Profile;
using System.Web.UI;
using System.Web.UI.WebControls;
public class Shop_UserControls_QQTaobaoContactMe : UserControl
{
	protected Image QQImage;
	protected HyperLink QQLink;
	protected Image TaobaoImage;
	protected HyperLink TaobaoLink;
	protected Literal ShowNoContactInfo;
	private int m_UserID = 0;
	private string m_Taobao = "";
	private string m_QQ = "";
	private string m_SalerName = "";
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	public int UserID
	{
		get
		{
			return this.m_UserID;
		}
		set
		{
			this.m_UserID = value;
		}
	}
	public string Taobao
	{
		get
		{
			return this.m_Taobao;
		}
		set
		{
			this.m_Taobao = value;
		}
	}
	public string QQ
	{
		get
		{
			return this.m_QQ;
		}
		set
		{
			this.m_QQ = value;
		}
	}
	public string SalerName
	{
		get
		{
			return this.m_SalerName;
		}
		set
		{
			this.m_SalerName = value;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		bool flag = false;
		bool flag2 = false;
		Shop shop = new Shop();
		DataRow dataRow = shop.shopconfig;
		if (dataRow["ShowQQ"].ToString() == "1")
		{
			flag = true;
		}
		if (dataRow["ShowWW"].ToString() == "1")
		{
			flag2 = true;
		}
		if (this.m_UserID > 0 && this.m_QQ == "" && this.m_Taobao == "")
		{
			dataRow = shop.user.UserInforRes;
			if (dataRow != null)
			{
				this.m_QQ = dataRow["OICQ"].ToString();
				this.m_Taobao = dataRow["Taobaowangwang"].ToString();
				this.m_SalerName = dataRow["UserName"].ToString();
			}
		}
		if (flag && this.m_QQ != "" && !string.IsNullOrEmpty(this.m_QQ) && this.m_SalerName != "" && !string.IsNullOrEmpty(this.m_SalerName))
		{
			this.QQImage.ImageUrl = "http://wpa.qq.com/pa?p=1:" + this.m_QQ + ":4";
			this.QQLink.NavigateUrl = string.Concat(new string[]
			{
				"http://wpa.qq.com/msgrd?V=1&Uin=",
				this.m_QQ,
				"&Site=",
				this.m_SalerName,
				"&Menu=yes"
			});
		}
		else
		{
			this.QQImage.Visible = false;
			this.QQLink.Visible = false;
		}
		if (flag2 && this.m_Taobao != "" && !string.IsNullOrEmpty(this.m_Taobao))
		{
			this.TaobaoImage.ImageUrl = "http://amos1.taobao.com/online.ww?v=2&uid=" + base.Server.UrlEncode(this.m_Taobao) + "&s=2";
			this.TaobaoLink.NavigateUrl = "http://amos1.taobao.com/msg.ww?v=2&Uid=" + base.Server.UrlEncode(this.m_Taobao) + "&s=2";
		}
		else
		{
			this.TaobaoImage.Visible = false;
			this.TaobaoLink.Visible = false;
		}
		if (!this.TaobaoImage.Visible && !this.QQImage.Visible)
		{
			this.ShowNoContactInfo.Visible = true;
		}
	}
}
